package com.xzz.thread.demo;

public class Test {
    public static void main(String[] args) {
        Warehouse warehouse = new Warehouse();
        Producer p1 = new Producer(warehouse,10);
        Producer p2 = new Producer(warehouse,20);
        Producer p3 = new Producer(warehouse,30);
        Consumer c1 = new Consumer(warehouse,5);
        Consumer c2 = new Consumer(warehouse,30);
        Consumer c3 = new Consumer(warehouse,25);

        Thread t1 = new Thread(c1);
        Thread t2 = new Thread(c2);
        Thread t3 = new Thread(c3);

        Thread t4 = new Thread(p1);
        Thread t5 = new Thread(p2);
        Thread t6 = new Thread(p3);

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();
    }
}
